<div ng-controller="providerInfoCtrl">
  <div class="col-xs-12 col-md-12">
      <div class="widget">
          <div class="widget-header  with-footer">
              <span class="widget-caption">供货商信息表</span>
          </div>
          <div class="widget-body" style="height: auto;">

            <div class="flip-scroll">
              <a style="float:right" id="editabledatatable_new" ng-click="addProviderBtn()" class="btn btn-default" style="margin-bottom:10px;">
                <i class="fa fa-plus"></i>添加新的供货商
              </a>
              <div class="form-group" style="width:240px;float:left;">
                  <span class="input-icon">
                      <input type="text" ng-model="checkProviderName" ng-keyup="keyupId()" class="form-control input ng-pristine ng-untouched ng-valid" placeholder="按名称查询供货商信息">
                      <i style="cursor:pointer" ng-click="checkProviderByName(checkProviderName)" class="glyphicon glyphicon-search darkorange"></i>
                  </span>
              </div>
              <a ng-click="clearCheck()" ng-if="clearResult" style="line-height: 34px;margin-left: 10px;">清除筛选</a>
                  <table class="table table-bordered table-striped table-condensed flip-content">
                      <thead class="flip-content bordered-darkorange">
                          <tr>
                              <th>
                                  序号
                              </th>
                              <th>
                                  名称
                              </th>
                              <th>
                                  纳税人识别号
                              </th>
                              <th>
                                  地址
                              </th>
                              <th class="numeric">
                                  电话
                              </th>
                              <th class="numeric">
                                  开户行
                              </th>
                              <th class="numeric">
                                  银行账号
                              </th>
                              <!-- <th class="numeric">
                                  负责人
                              </th> -->
                              <!-- <th class="numeric">
                                  所属省份
                              </th> -->
                              <th class="numeric">
                                  操作
                              </th>
                          </tr>
                      </thead>
                      <tbody>
                        <tr ng-repeat="provider in providers">
                            <td>
                                {{(currentPage-1)*size+$index+1}}
                            </td>
                            <td>
                              {{provider.companyName}}
                            </td>
                            <td>
                              {{provider.companyNumber}}
                            </td>
                            <td>
                                {{provider.companyAddress}}
                            </td>
                            <td class="numeric">
                                {{provider.companyPhone}}
                            </td>
                            <td class="numeric">
                              {{provider.bank}}
                            </td>
                            <td class="numeric">
                              {{provider.companyAccount}}
                            </td>
                            <!-- <td class="numeric">
                              {{provider.companyUser}}
                            </td> -->
                            <!-- <td class="numeric">
                              {{provider.companyRegion}}
                            </td> -->
                            <td class="numeric">
                              <a class="btn btn-info btn-xs updateuser edit" ng-click="updateProviderFun(provider)"><i class="fa fa-edit"></i> 修改</a>
                              <a class="btn btn-danger btn-xs delete" ng-click="delProvider(provider.companyId)"><i class="fa fa-trash-o"></i> 删除</a>
                            </td>
                      </tbody>
                  </table>
            </div>
            <pagination ng-if="totalPage>1" current-page="currentPage" total-page="totalPage" get-record="getRecord()">
            </pagination>
          </div>
      </div>
  </div>
  <!-- 删除确认弹框 -->
  <div class="modal-preview "  ng-if="showModal">
    <div class="modal modal-primary">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" ng-click="delProvider()" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 class="modal-title">删除供货商</h4>
          </div>
          <div class="modal-body">
            <p>确认删除此供货商信息？请谨慎操作！</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-warning" data-dismiss="modal" ng-click="delProvider()">取消</button>
            <button type="button" class="btn btn-primary" ng-click="sureDelProvider()">确认</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 修改弹框   -->
  <div class="col-lg-5 col-sm-5 col-xs-11 update-model" ng-if="showUModel">
      <div class="widget">
          <div class="widget-header bordered-bottom bordered-darkorange">
              <span class="widget-caption">修改客户信息</span>
              <a style="float:right;line-height:33px;margin-right:12px;font-size:14px;" ng-click="hideUModel()">
                  <i class="fa fa-times"></i>
              </a>
          </div>
          <div class="widget-body">
              <div id="horizontal-form">
                  <form class="form-horizontal" role="form">
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">名称</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.companyName" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">纳税人识别号</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.companyNumber" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">地址</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.companyAddress" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">电话</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.companyPhone" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputPassword3" class="col-sm-2 control-label no-padding-right">开户行</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.bank" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputPassword3" class="col-sm-2 control-label no-padding-right">银行账号</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="updateProvider.companyAccount" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <div class="col-sm-offset-2 col-sm-10">
                              <button type="submit" ng-click="sureUpdateProvider()" class="btn btn-default">确认修改</button>
                          </div>
                      </div>
                  </form>
              </div>
          </div>
      </div>
  </div>
  <!-- 添加弹框   -->
  <div class="col-lg-5 col-sm-5 col-xs-11 update-model" ng-if="showAModel">
      <div class="widget">
          <div class="widget-header bordered-bottom bordered-darkorange">
              <span class="widget-caption">添加新的供货商信息</span>
              <a style="float:right;line-height:33px;margin-right:12px;font-size:14px;" ng-click="addProviderBtn()">
                  <i class="fa fa-times"></i>
              </a>
          </div>
          <div class="widget-body">
              <div id="horizontal-form">
                  <form class="form-horizontal" role="form">
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">名称</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.companyName" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">纳税人识别号</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.companyNumber" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">地址</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.companyAddress" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">电话</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.companyPhone" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputPassword3" class="col-sm-2 control-label no-padding-right">开户行</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.bank" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <label for="inputPassword3" class="col-sm-2 control-label no-padding-right">银行账号</label>
                          <div class="col-sm-10">
                              <input type="text" ng-model="newProvider.companyAccount" class="form-control">
                          </div>
                      </div>
                      <div class="form-group">
                          <div class="col-sm-offset-2 col-sm-10">
                              <button type="submit" ng-click="addProvider()" class="btn btn-default">确认添加</button>
                          </div>
                      </div>
                  </form>
              </div>
          </div>
      </div>
  </div>
  <div class="mask" ng-if="showModal"></div>
  <div class="mask" ng-if="showUModel"></div>
  <div class="mask" ng-if="showAModel"></div>
  <div class="clear"></div>
</div>
<script>
$(function() {
  $( ".modal-preview" ).draggable();
});
//--Bootstrap Date Range Picker--
      $('#reservation').daterangepicker();
</script>
